package com.srit.map.web.action;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.srit.core.struts2.action.CrudAction;
import com.srit.map.business.bean.User;
import com.srit.map.business.service.MenuService;
import com.srit.map.business.service.UserService;

public class IndexAction extends CrudAction {

	/**
	 * 跳转到首页
	 * 
	 * @return
	 */
	@Autowired(required = true)
	private UserService userService;
	@Autowired(required = true)
	private MenuService menuService;
	public String renderIndex() {
		User user=new User();
		user.setUsername("admin");
		user.setId(1);
		User tmp=userService.getUserByUsername(user);
		List menuList=userService.getMenuByUser(user);
		request.setAttribute("menuList",menuList );
		return SUCCESS;
	}

	@Override
	public Object getModel() {
		// TODO Auto-generated method stub
		return null;
	}

}
